package com.example.myDesignPatterns.创建者模式.原型模式.深克隆.finishedProduct;

import com.example.myDesignPatterns.创建者模式.原型模式.深克隆.assembly.Citation;
import com.example.myDesignPatterns.创建者模式.原型模式.深克隆.bean.Student;

public class CitationTest1 {
    public static void main(String[] args) throws CloneNotSupportedException {
        Citation c1 = new Citation();
        Student stu = new Student("张三", "西安");
        c1.setStu(stu);

        Citation c2 = (Citation) c1.clone();

        Student stu1 = c2.getStu();
        stu1.setName("李四");
        System.out.println("stu和stu1是同一个对象？" + (stu == stu1));
        c1.show();
        c2.show();
    }
}
